package concurrent;

import java.util.concurrent.ConcurrentHashMap;

/**
 * Author: Jason Wu
 * Date  : 2014-03-13
 */
public class TestConcurrentMapModify {
    public static void main(String[] args) {
        ConcurrentHashMap<String, Integer> map = new ConcurrentHashMap<String, Integer>();
        map.put("aa", 1);
        map.put("bb", 1);
        map.put("cc", 1);
        for (String s : map.keySet()) {
            if (s.equals("bb")) {
                map.remove(s);
            }
        }
        System.out.println(map);
    }
}
